//
//  UIView+LayoutDirection.m
//  CareRingApp
//
//  Created by Linktop on 2024/8/6.
//

#import "UIView+LayoutDirection.h"

@implementation UIView (LayoutDirection)

-(BOOL)directionFromLeft
{
    BOOL fromLeft = YES;
    if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) {
        // 当前语言的显示界面是从右往左排列
//        NSLog(@"当前语言是从右往左排列");
        fromLeft = NO;
    } else {
        // 当前语言的显示界面是从左往右排列
//        NSLog(@"当前语言是从左往右排列");
        fromLeft = YES;
    }
    return fromLeft;
}

@end
